package com.ddfeiyu;


import com.ddfeiyu.redis.properties.RedisProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

//自动加载配置信息
@Configuration
@EnableAutoConfiguration
@EnableConfigurationProperties({ServerProperties.class, RedisProperties.class})
//使包路径下带有@Value的注解自动注入
// 使包路径下带有@Autowired的类可以自动注入
@ComponentScan("com.ddfeiyu")
@SpringBootApplication
public class LogDemoApplication implements CommandLineRunner {

	private static Logger logger = LoggerFactory.getLogger(LogDemoApplication.class);


	public static void main(String[] args) throws Exception {
		logger.info("LogDemoApplication 启动服务开始 {}", args);

		SpringApplication.run(LogDemoApplication.class);

		logger.info("LogDemoApplication 启动服务完成 {}", args);
	}

	@Override
	public void run(String... args) throws Exception {

		logger.info("LogDemoApplication 启动服务CommandLineRunner完成 {}", args);
	}

}